<div class="headline">
  <h2>
    <?php echo $this->translate('Pages');?>
  </h2>
  <div class="tabs">
    <?php
      // Render the menu
      echo $this->navigation()
        ->menu()
        ->setContainer($this->navigation)
        ->render();
    ?>
  </div>
</div>

<div class='layout_right'>
  <div class="cmspages_gutter">
	  <?php echo $this->form->render($this) ?>
	  <?php if( $this->can_create): ?>
	    <div class="quicklinks">
	      <ul>
	        <li>
	          <a href='<?php echo $this->url(array(), 'cmspage_create', true) ?>' class='buttonlink icon_cmspage_new'><?php echo $this->translate('Post New Page');?></a>
	        </li>
	      </ul>
	    </div>
	  <?php endif; ?>
    
		<?php if( $this->recentPostedPaginator->getTotalItemCount() > 0 ): ?>
			<div class="cmspages_sticky">
			  <h4><?php echo $this->translate('Sticky Pages'); ?></h4>
			  <ul>
			    <?php foreach( $this->stickyPaginator as $item ): ?>
			      <li>
			  <?php echo $this->htmlLink($item->getHref(), $item->getTitle()) ?>
			      </li>
			    <?php endforeach; ?>
			  </ul>
			</div>  
		<?php endif; // end Sticky Pages ?>
    
  </div>
</div>

<div class='layout_middle'>

  <div class='cmspage_layout_landing_content'>
    <div class='cmspage_layout_landing_content_left'>
    
      <ul class="cmspage_landing_categories">
        <?php foreach ($this->categories as $category): ?>
          <li>
            <div class="cmspage_category_title">
	            <?php echo $this->htmlLink(array('route'=>'cmspage_browse','category'=>$category->category_id),
	              $this->translate($category->category_name)
	            )?>
            </div>
            <div class="cmspage_category_description">
              <?php echo $this->translate($category->description); ?>
            </div>
          </li>
        <?php endforeach;?>
      </ul>
    
    </div>
    <!-- / cmspage_layout_landing_content_left -->
    
    <div class='cmspage_layout_landing_content_right'>    
    
      <?php if( $this->recentPostedPaginator->getTotalItemCount() > 0 ): ?>
        <div class="cmspages_recent">
          <h3 class="sep"><span><?php echo $this->translate('Recently Posted'); ?></span></h3>
          <ul>
            <?php foreach( $this->recentPostedPaginator as $item ): ?>
              <li>
                <?php echo $this->htmlLink($item->getHref(), $item->getTitle()) ?>
              </li>
            <?php endforeach; ?>
          </ul>
        </div>  
      <?php endif; // end Recently Posted ?>

      <?php if (!empty($this->tags)): ?>
      <div class="radcodes_popular_tags cmspages_popular_tags">
        <h3 class="sep"><span><?php echo $this->translate('Popular Tags'); ?></span></h3>
        <ul>
        <?php foreach ($this->tags as $k => $tag): ?>
          <li><?php echo $this->htmlLink(array(
                      'route' => 'cmspage_browse',
                      'tag' => $tag->tag_id),
            $tag->text, 
            array('class'=> "tag_$k")
          )?>
          <sup><?php echo $tag->total; ?></sup>
          </li>
        <?php endforeach; ?>
        </ul>
      </div>
      <?php endif; // end tags ?>


    </div>
    <!-- / cmspage_layout_landing_content_right -->
  </div>

</div>
